<?php $this->_extends('../_layouts/blank_layout'); ?>
<?php $this->_block('contents'); ?>
<script src="<?=Q::ini('custom_system/base_url');?>js/validator.js"></script>
<form method="post" action="<?=url('Setting::Basic/ShippingMethodSave')?>" onSubmit="return Validator.Validate(this,3);">
<table class="form_table">
<tr>
	<th>ID</th>
	<td>
		<input type="text" disabled="disabled" value="<?=isset($shipping_method['id']) ? $shipping_method['id'] : '自动生成'?>" />
		<input type="hidden" name="id" value="<?=isset($shipping_method['id']) ? $shipping_method['id'] : ''?>" />
	</td>
</tr>
<tr>
	<th>名称</th>
	<td><input type="text" name="name" value="<?=isset($shipping_method['name']) ? $shipping_method['name'] : '';?>" dataType="Require" msg=" 请填写名称"/></td>
</tr>
<tr>
	<th>代号</th>
	<td><input type="text" name="code" value="<?=isset($shipping_method['code']) ? $shipping_method['code'] : '';?>" dataType="Require" msg=" 请填写代号"/></td>
</tr>
<tr>
	<th>仓库</th>
	<td>
		<select name="warehouse_id" dataType="Require" msg=" 请选择仓库">
			<option value="">请选择..</option>
			<?foreach($warehouse as $w):?>
			<option value="<?=$w['id']?>" <?if (isset($shipping_method['warehouse_id']) && $shipping_method['warehouse_id'] == $w['id'])echo "selected='selected'"?>><?=$w['name']?></option>
			<?endforeach;?>
		</select>
	</td>
</tr>
<tr>
	<th>状态</th>
	<td>
	<select name="status">
		<option value="">请选择...</option>
		<option value="1" <?if (isset($shipping_method['status']) && $shipping_method['status'] == 1) echo "selected='selected'"?>>上线</option>
		<option value="0" <?if (isset($shipping_method['status']) && $shipping_method['status'] == 0) echo "selected='selected'"?>>下线</option>
	</select>
	</td>
</tr>
<tr>
	<th>ShippingCarrier</th>
	<td><input type="text" name="shipping_carrier" value="<?=isset($shipping_method['shipping_carrier']) ? $shipping_method['shipping_carrier'] : ''?>" /></td>
</tr>
<tr>
	<th>CarrierCode</th>
	<td><input type="text" name="carrier_code" value="<?=isset($shipping_method['carrier_code']) ? $shipping_method['carrier_code'] : ''?>" /></td>
</tr>
<tr>
	<th>打印代号</th>
	<td><input type="text" name="address_model" value="<?=isset($shipping_method['address_model']) ? $shipping_method['address_model'] : '';?>" /></td>
</tr>
<tr>
	<th>运费计算公式</th>
	<td><textarea name="formula" rows="15" cols="120"><?=isset($shipping_method['formula']) ? $shipping_method['formula'] : ''?></textarea></td>
</tr>
<tr>
	<th>排序</th>
	<td><input type="text" name="sort" value="<?=isset($shipping_method['sort']) ? $shipping_method['sort'] : '';?>" /></td>
</tr>
<tr>
	<th><input type="hidden" name="<?=Q::ini('unique_token_name');?>" value="<?=Helper_BSS_Normal::genToken();?>"/></th>
	<td><input type="submit" class="button" value="保存" /></td>
</tr>
</table>
</form>
<?php $this->_endblock();?>